package com.group2.operations.flowable;

import com.group2.operations.mapper.StoreMapper;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.JavaDelegate;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

import java.util.Map;


public class NoticeDelegate implements JavaDelegate{


    @Override
    public void execute(DelegateExecution delegateExecution) {
        System.out.println("一般流程");
//        Map<String, Object> variables = delegateExecution.getVariables();
//        //获取流程名
//        String processName = (String) variables.get("processName");
//        if("改变厅店状态".equals(processName)) {
//            StoreMapper storeMapper = (StoreMapper) applicationContext.getBean("StoreMapper");
//            //获取厅店ID
//            int sid = (int) variables.get("sid");
//            //获取目标状态变更
//            boolean targetState = (boolean) variables.get("targetState");
//            storeMapper.changeStateById(targetState, sid);
//
//        }
    }

}
